<%--
  Created by IntelliJ IDEA.
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java"
         pageEncoding="UTF-8" isELIgnored="false" import="java.util.*"%>

<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<html>
<!-- 新 Bootstrap 核心 CSS 文件 -->
<link href="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">

<!-- jQuery文件。务必在bootstrap.min.js 之前引入 -->
<script src="https://cdn.staticfile.org/jquery/2.1.1/jquery.min.js"></script>

<!-- 最新的 Bootstrap 核心 JavaScript 文件 -->
<script src="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/js/bootstrap.min.js"></script>
<head>
    <title>部门管理</title>
</head>
<body background="../gz.jpg">
<div class="container-fluid">
    <div class="row clearfix">
        <div class="col-md-12 column">
            <nav class="navbar navbar-default navbar-fixed-top" role="navigation">
                <div class="navbar-header">
                    <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
                        ss</button> <a class="navbar-brand" href="adminmain.jsp">管理员主页</a>
                </div>
                <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
                    <ul class="nav navbar-nav">
                        <li >
                            <a href="getdeptServlet" >查询所有部门信息</a>
                        </li>
                        <li >
                            <a href="adminadddept.jsp" >添加新部门</a>
                        </li>
                    
                    </ul>

                    <ul class="nav navbar-nav navbar-right">
                        <li class="dropdown">
                            <a href="#" class="dropdown-toggle" data-toggle="dropdown"><span class="glyphicon glyphicon-th-list"></span><strong class="caret"></strong></a>
                            <ul class="dropdown-menu">
                                <li>
                                    <a href="../login.jsp">切换账号</a>
                                </li>
                                <li class="divider">
                                </li>
                                <li>
                                    <a href="../logout">退出系统</a>
                                </li>
                            </ul>
                        </li>
                    </ul>
                </div>

            </nav>
            <br><br><br>
            <!-- 使用jsp中的for循环来遍历List -->
            <table class="table table-striped">
                <caption>查询结果</caption>
                <thead>
                <tr>
                    <th>部门号</th>
                    <th>部门名</th>
                    <th>修改</th>
                    <th>删除</th>
                </tr>
                </thead>
                <tbody>
                <c:forEach items="${depts}" var="dept" >
                    <tr>
                        <td>${dept.dnumber}</td>
                        <td>${dept.dname}</td>
                        <td><a href="admineditdept.jsp?dnumber=${dept.dnumber}">修改</a></td>
                        <td><a href="deletedept?dnumber=${dept.dnumber}">删除</a></td>
                    </tr>
                </c:forEach>
                </tbody>
            </table>
        </div>
    </div>

</div>
</body>
</html>
